# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=cargo-sort
pkgver=1.0.9_git20240110
_gitrev=55ec89082466f6bb246d870a8d56d166a8e1f08b
pkgrel=0
pkgdesc="Check if tables and items in a .toml file are lexically sorted"
url="https://github.com/DevinR528/cargo-sort"
arch="all"
license="MIT OR Apache-2.0"
makedepends="cargo-auditable"
depends="cargo"
source="
	$pkgname-$_gitrev.tar.gz::https://github.com/DevinR528/cargo-sort/archive/$_gitrev.tar.gz
"
options="net"
builddir="$srcdir/$pkgname-$_gitrev"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm 755 target/release/cargo-sort "$pkgdir"/usr/bin/cargo-sort
}

sha512sums="
064ccafb11d250bb20453eba55eb1b108f1cb6ef3dda4728f0462a2d4c011da884443c7fd4de7b7d2a1cc8ac3ac4cf0ca1658c08f0be561844fc9e7553a430a1  cargo-sort-55ec89082466f6bb246d870a8d56d166a8e1f08b.tar.gz
"
